package com.mall.pay.dto;

import com.mall.commons.result.AbstractRequest;
import com.mall.commons.tool.exception.ValidateException;
import com.mall.pay.constant.PayRetCode;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;


/**
 * @author
 * @date 2020/12/24 11:50
 */
@Data
public class PayCodeRequest extends AbstractRequest{

    private String info;
    private BigDecimal money;
    private String nickName;
    private String orderId;
    private String payType;

    @Override
    public void requestCheck() {
        if(StringUtils.isBlank(info)
                || StringUtils.isBlank(nickName)
                || StringUtils.isBlank(orderId)
                || StringUtils.isBlank(payType)
                || money == null){
            throw new ValidateException(PayRetCode.PAY_PARAMETER_ERROR.getCode(),PayRetCode.PAY_PARAMETER_ERROR.getMessage());
        }
    }
}
